import { Request, Response, NextFunction } from 'express';

// 404 处理中间件
const notFound = (req: Request, res: Response, next: NextFunction): void => {
  res.status(404).json({
    success: false,
    message: `路径 ${req.originalUrl} 不存在`,
    availableEndpoints: [
      'GET /',
      'GET /api/docs',
      'GET /api/users',
      'GET /api/users/:id',
      'POST /api/users',
      'PUT /api/users/:id',
      'DELETE /api/users/:id',
      'POST /api/auth/login',
      'POST /api/auth/register',
      'GET /api/auth/me',
      'POST /api/auth/logout'
    ]
  });
};

export default notFound;
